<!DOCTYPE html>
<html lang="en">
<head>
    <div th:include="base-libs-easyui :: base-libs-easyui"/>
    <meta charset="UTF-8">
    <title>查询配置的运行评价页面</title>
</head>
<script type="text/javascript">
    $(function () {
        initDatagrid();
        queryYxpjpzList();
    });

    function initDatagrid() {
        $("#dg").datagrid({
            idField: "BDID",
            toolbar: "#toolbar",
            fit:true,
            fitColumns:true,
            columns: [[
                {
                    field: "MBMC",
                    title: "模板名称",
                    width:3
                },
                {
                    field: "asd",
                    title: "选择页面",
                    width:1,
                    formatter: function (value, row, index) {
                        var id = row.BDID, mc = row.BDMC;
                        var a = "<a class='tableToolBarBtn' action='select' href='javascript:void(0)' title='确定' style='color: #00c297;' bdid = '" + id + "' bdmc = '" + mc + "'>确定</a>";
                        return a;
                    }
                }
            ]],
            onSelect:function(rowIndex, rowData){
                $(this).datagrid("unselectRow",rowIndex);
            }
        });
        $("body").on("click", ".tableToolBarBtn[action=select]", function () {
            var id = $(this).attr("bdid");
            selectYxpjpz(id);
        });
    }

    /**  选择页面，关闭弹窗  */
    function selectYxpjpz(id){
        StoreCache.setCache("yxpj_bdid", id);
        parent.layer.closeAll();
    }

    function queryYxpjpzList() {
        var name = $("#toolbar").children("input[name=name]").val() || "";
        $.QuickRemote.AjaxJson("queryUnLinked", function (result) {
            $("#dg").datagrid({data: result});
        }, {name: name});
    }
</script>
<body style="">
<div id="toolbar" style="padding: 10px;">
    关键字
    <input name="name" type="text" placeholder="搜索关键字" class="form-control"/>
    <button type="button" style=" margin-left: 10px;" onclick="queryYxpjpzList()">查询</button>
</div>
<table id="dg" style="width:100%;height: 100%;"></table>
</body>
</html>